package io.renren.modules.region.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.region.dao.V9RegionDao;
import io.renren.modules.region.entity.V9RegionEntity;
import io.renren.modules.region.service.V9RegionService;


@Service("v9RegionService")
public class V9RegionServiceImpl extends ServiceImpl<V9RegionDao, V9RegionEntity> implements V9RegionService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
    	String region_name=(String) params.get("region_name");
        IPage<V9RegionEntity> page = this.page(
                new Query<V9RegionEntity>().getPage(params),
                new QueryWrapper<V9RegionEntity>()
                .like(StringUtils.isNotBlank(region_name), "region_name", "%"+region_name+"%")
        );

        return new PageUtils(page);
    }

}